package com.woniuxy.ribbon.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RibbonConfig {
    //添加负载均衡策略对象
    @Bean
    public IRule createIRule() {
        return new RandomRule();//将负债均衡规则改为 随机
    }
}
